<#import "commons.ftl" as m/>
###
# application.yml 开始
###
spring:
	profiles:
		active: dev
	messages:
		basename: i18n/messages
		encoding: UTF-8
mybatis:
	mapper-locations: classpath:mapper/*.xml
	config-location: classpath:mybatis-config.xml
	type-aliases-package: <@m.getBasePackage param=context flag=true/><@m.getModelPackage param=context flag=false/>,<@m.getBasePackage param=context flag=true/><@m.getQueryPackage param=context flag=false/>

###
# application.yml 开始
###

####
# application-dev.yml 开始
####
server:
	port: 8080
	undertow:
		io-threads: 8
		worker-threads: 64
		buffer-size: 1024
		accesslog:
			dir: ./access/logs/access_log
			enabled: true
			pattern: '[%{time,yyyy-MM-dd HH:mm:ss.S z}], %m, %U, "%q", %s, %D, %b, %{i,X-B3-TraceId}, %{i,X-B3-SpanId}, %{i,X-Real-IP}, %{i,Referer}, "%{i,User-Agent}", %{i,Platform}, %l, %u, %I, %v, %a'
---
spring:
	application:
		name: 'my-app-name'
	datasource:
		type: com.zaxxer.hikari.HikariDataSource
		url: ${(context.db.url)!}
		username: ${(context.db.username)!}
		password: ${(context.db.password)!}
		driver-class-name: com.mysql.cj.jdbc.Driver
		hikari:
			pool-name: 'my-app-pool-name'
			connectionTestQuery: SELECT 1
			maximum-pool-size: 150
			minimum-idle: 10
			max-lifetime: 1800000
			connection-timeout: 30000
logging:
	config: classpath:dev/log4j2.xml

####
# application-dev.yml 结束
####

####
# 依赖开始
####
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.8</jdk.version>
<spring.cloud>Greenwich.SR2</spring.cloud>
<spring.boot>2.1.8.RELEASE</spring.boot>
<mybatis-spring-boot-starter.version>1.2.0</mybatis-spring-boot-starter.version>
<disruptor.version>3.3.7</disruptor.version>
<swagger.annotations.version>1.5.22</swagger.annotations.version>
<swagger.version>2.7.0</swagger.version>

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<configuration>
		<target>${r'${jdk.version}'}</target>
		<source>${r'${jdk.version}'}</source>
		<encoding>${r'${project.build.sourceEncoding}'}</encoding>
	</configuration>
</plugin>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-dependencies</artifactId>
			<version>${r'${spring.boot}'}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<repositories>
	<repository>
		<id>spring-milestones</id>
		<name>Spring Milestones</name>
		<url>https://repo.spring.io/libs-milestone</url>
		<snapshots>
			<enabled>true</enabled>
		</snapshots>
	</repository>
</repositories>

##
# commons
##

<dependency>
	<groupId>org.hibernate.validator</groupId>
	<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-context</artifactId>
	<exclusions>
		<exclusion>
			<groupId>*</groupId>
			<artifactId>*</artifactId>
		</exclusion>
	</exclusions>
</dependency>
<dependency>
	<groupId>io.swagger</groupId>
	<artifactId>swagger-annotations</artifactId>
	<version>${r'${swagger.annotations.version}'}</version>
</dependency>
<dependency>
	<groupId>org.projectlombok</groupId>
	<artifactId>lombok</artifactId>
</dependency>

##
# commons
##

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
	<exclusions>
		<exclusion>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-logging</artifactId>
		</exclusion>
		<exclusion>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-tomcat</artifactId>
		</exclusion>
	</exclusions>
</dependency>
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
	<groupId>org.mybatis.spring.boot</groupId>
	<artifactId>mybatis-spring-boot-starter</artifactId>
	<version>1.2.0</version>
</dependency>
<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
	<groupId>com.lmax</groupId>
	<artifactId>disruptor</artifactId>
	<version>3.3.7</version>
</dependency>

####
# 依赖结束
####

##
# log4j2 开始
##
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
	<Appenders>
		<Console name="Console" target="SYSTEM_OUT">
			<PatternLayout pattern="%d{yy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
		</Console>
	</Appenders>
	<Loggers>
		<AsyncLogger name="springfox" level="warn" includeLocation="true">
			<AppenderRef ref="Console" />
		</AsyncLogger>
		<AsyncLogger name="org.mybatis" level="info" includeLocation="true">
			<AppenderRef ref="Console" />
		</AsyncLogger>
		<AsyncLogger name="org.apache" level="info" includeLocation="true">
			<AppenderRef ref="Console" />
		</AsyncLogger>
		<AsyncLogger name="org.springframework" level="info" includeLocation="true">
			<AppenderRef ref="Console" />
		</AsyncLogger>
		<AsyncLogger name="org.hibernate" level="info" includeLocation="true">
			<AppenderRef ref="Console" />
		</AsyncLogger>
		<Root level="debug">
			<AppenderRef ref="Console" />
		</Root>
	</Loggers>
</Configuration>

##
# 日志结束
##

###
# mybatis-config.xml
###
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

	<typeAliases>
		<typeAlias alias="Integer" type="java.lang.Integer" />
		<typeAlias alias="Long" type="java.lang.Long" />
		<typeAlias alias="HashMap" type="java.util.HashMap" />
		<typeAlias alias="LinkedHashMap" type="java.util.LinkedHashMap" />
		<typeAlias alias="ArrayList" type="java.util.ArrayList" />
		<typeAlias alias="LinkedList" type="java.util.LinkedList" />
	</typeAliases>

</configuration>

###
# 结束
###